# Package file for core package
#

from environment import (Environment, Settings)
from scene import Scene
from scene_view import SceneViewWidget 
from plugin_interfaces import (IViewPlugin, IFcEditorPlugin, IFcEditorGroupPlugin)
from plugin_holder import ViewPluginsHolder

# Signal Constants
#
# Import lucid.core to get access to them as lucid.core.signal.XXX
class SignalContainer:
    """ Holds constant signal values.
    ActiveSceneChanged: Called whenever the active scene is changed in the environment.
    SelectedNodeChanged: Called whenever a new nodes is selected in the environment.
    SelectedFieldContainerChange: Called whenever a new field container is selected.
    SelectedFieldContainerModified: Called whenever the application changes the state 
                                    of the selected fc
    SaveStateForExit: Called immediately before exit to save the state of the program.
    """
    class SignalError(TypeError): pass 
    def __init__(self):
        self.ActiveSceneChanged = 'ActiveSceneChanged'        
        self.SceneAdded = 'SceneAdded'
        self.SaveStateForExit = 'SaveStateForExit'
        self.SelectedNodeChanged = 'SelectedNodeChanged'
        self.SelectedFieldContainerChanged = 'SelectedFCChanged'
        self.SelectedFieldContainerModified = 'SelectedFCModified'
        # Potential arguments: added=[], removed=[]
        self.PoolChanged = 'PoolChanged'
        self.TypeMapChanged = 'TypeMapChanged'
        
    def __setattr__(self,name,value):
        if self.__dict__.has_key(name):
            raise self.ConstError, "Can't rebind signal(%s)"%name
        self.__dict__[name]=value

# Accessor for signals
signal = SignalContainer()